CC = g++
#OPT = -O3
OPT = -g

TOP = ..
INC = -I. \
      -I$(TOP)/LibSS_smt/include \
      -I./BPRED -I./MEM -I./UTILS 
LIB = -L$(TOP)/LibSS_smt/lib \
      -L./BPRED -L./MEM -L./UTILS 

SIM_LINUX = -DSIM_LINUX
ENDIAN = -DBYTES_LITTLE_ENDIAN -DWORDS_LITTLE_ENDIAN

#WARN = -Wall
CFLAGS = $(OPT) $(WARN) $(INC) $(LIB) $(SIM_LINUX) $(ENDIAN)

SIM_SRC = checker.cc	decode.cc	dispatch.cc	execute.cc	fetch.cc	fetch_queue.cc	globals.cc	issue_queue.cc	lane.cc	parameters.cc	payload.cc	pipeline_register.cc	Prerename.cc	processing_element.cc	processor.cc	register_read.cc	rename.cc	renamer.cc	retire.cc	schedule.cc	simulator.cc	sim_input.cc	sim_output.cc	squash.cc	trace_dispatch.cc	trace_queue.cc	writeback.cc

SIM_OBJ = checker.o	decode.o	dispatch.o	execute.o	fetch.o	fetch_queue.o	globals.o	issue_queue.o	lane.o	parameters.o	payload.o	pipeline_register.o	Prerename.o	processing_element.o	processor.o	register_read.o	rename.o	renamer.o	retire.o	schedule.o	simulator.o	sim_input.o	sim_output.o	squash.o	trace_dispatch.o	trace_queue.o	writeback.o


all: little

little: $(SIM_OBJ)
	$(CC) -o sim_little $(CFLAGS) \
		$(SIM_OBJ) -lBP_little -lMEM_little -lUTILS_little \
		-lSS_smt_little
	@echo "-----------DONE WITH SIM FOR LITTLE ENDIAN-----------"

.cc.o:
	$(CC) $(CFLAGS) -c $*.cc


clean:
	rm -f *.o core Makefile.bak sim_little

clobber:
	rm -f *.o
